package com.ruoyi.erp.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.SecurityUtils;
import com.ruoyi.erp.domain.ErpPs;
import com.ruoyi.erp.mapper.ErpPsMapper;
import com.ruoyi.erp.service.IErpPsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 计划订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-10
 */
@Service
public class ErpPsServiceImpl implements IErpPsService 
{
    @Resource
    private ErpPsMapper erpPsMapper;

    /**
     * 查询计划订单
     * 
     * @param erpPsUuid 计划订单主键
     * @return 计划订单
     */
    @Override
    public ErpPs selectErpPsByErpPsUuid(String erpPsUuid)
    {
        return erpPsMapper.selectErpPsByErpPsUuid(erpPsUuid);
    }



    /**
     * 查询计划订单列表
     * 
     * @param erpPs 计划订单
     * @return 计划订单
     */
    @Override
    public List<ErpPs> selectErpPsList(ErpPs erpPs)
    {
        return erpPsMapper.selectErpPsList(erpPs);
    }

    /**
     * 新增计划订单
     * 
     * @param erpPs 计划订单
     * @return 结果
     */
    @Override
    public int insertErpPs(ErpPs erpPs)
    {
        erpPs.setCreateBy(SecurityUtils.getUsername());
        erpPs.setCreateTime(DateUtils.getNowDate());
        return erpPsMapper.insertErpPs(erpPs);
    }

    /**
     * 修改计划订单
     * 
     * @param erpPs 计划订单
     * @return 结果
     */
    @Override
    public int updateErpPs(ErpPs erpPs)
    {
        erpPs.setUpdateBy(SecurityUtils.getUsername());
        erpPs.setUpdateTime(DateUtils.getNowDate());
        return erpPsMapper.updateErpPs(erpPs);
    }

    /**
     * 批量删除计划订单
     * 
     * @param erpPsUuids 需要删除的计划订单主键
     * @return 结果
     */
    @Override
    public int deleteErpPsByErpPsUuids(String[] erpPsUuids)
    {
        return erpPsMapper.deleteErpPsByErpPsUuids(erpPsUuids);
    }

    /**
     * 删除计划订单信息
     * 
     * @param erpPsUuid 计划订单主键
     * @return 结果
     */
    @Override
    public int deleteErpPsByErpPsUuid(String erpPsUuid)
    {
        return erpPsMapper.deleteErpPsByErpPsUuid(erpPsUuid);
    }
}
